﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using TTGame;

/*
 * RecycleInfo
 *
 * 从ObjectRecycle中实例的对象，将会记录这些信息，用于方便之后回收的信息。
 * 注：仅仅是结构体，非脚本
 *
 *
 * 依赖：
 *
 * ！不写重复代码！
 * @author TTun
 * @date 11/10/2017 11:05:37 AM
 */
namespace TTGameEngine {
public class RecycleInfo {
    //true:使用坐标将对象移到屏幕外。  false:直接隐藏对象
    public GameObject prefab;
    public Transform rootNode;
    public bool broadCast = false;
    public bool isUsePosHide = false;

    public static RecycleInfo CreateInfo(GameObject aPrefab, Transform aRootNode, bool aIsUsePosHide, bool aBroadCast) {
        return new RecycleInfo().SetInfo(aPrefab, aRootNode, aIsUsePosHide, aBroadCast);
    }

    public RecycleInfo SetInfo(GameObject aPrefab, Transform aRootNode, bool aIsUsePosHide, bool aBroadCast) {
        prefab = aPrefab;
        rootNode = aRootNode;
        isUsePosHide = aIsUsePosHide;
        broadCast = aBroadCast;
        return this;
    }

    public void Clear() {
        isUsePosHide = false;
        broadCast = false;
        prefab = null;
        rootNode = null;
    }
}

}
